<script setup>
import { RouterLink, RouterView, useRoute } from 'vue-router'

const route = useRoute()

</script>

<template>
  <div class="main">
    <div class="nav">
      <div class="nav-item">
        <RouterLink to="/base" :style="{color: route.path == '/base' ? 'red' : 'blue'}">主应用test</RouterLink>
      </div>
      <div class="nav-item">
        <RouterLink to="/team1/vue1" :style="{color: route.path == '/team1/vue1' ? 'red' : 'blue'}">子应用vue1</RouterLink>
      </div>
      <div class="nav-item">
        <RouterLink to="/team1/vue1/page2" :style="{color: route.path === '/team1/vue1/page2' ? 'red' : 'blue'}">子应用vue1下级页面2</RouterLink>
      </div>
      <div class="nav-item">
        <RouterLink to="/team2/#/vue2" :style="{color: route.path === '/team2/vue2/page1' ? 'red' : 'blue'}">子应用vue2</RouterLink>
      </div>
      <div class="nav-item">
        <RouterLink to="/team2/#/vue2/page2" :style="{color: route.path === '/team2/vue2/page2' ? 'red' : 'blue'}">子应用vue2下级页面2</RouterLink>
      </div>
    </div>
    <div class="content">
      <RouterView />
    </div>
  </div>
</template>

<style scoped>
.main {
  height: 100%;
  display: flex;
}
.nav {
  width: 200px;
  height: 100%;
  padding: 8px;
  display: flex;
  flex-direction: column;
  background-color: #eee;
}
.nav-item {
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 17px;
}
.content {
  flex: 1;
}
</style>
